package com.mesSystem.service.impl.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mesSystem.entity.Workstation;
import com.mesSystem.mapper.WorkstationMapper;
import com.mesSystem.service.impl.WorkstationService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkstationServiceImpl extends ServiceImpl<WorkstationMapper, Workstation> implements WorkstationService {
    public boolean isNameNotExist(String workstationName) {
        QueryWrapper<Workstation> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("name", workstationName);
        Integer count = baseMapper.selectCount(queryWrapper);
        return count < 1;
    }

    public String getWorkstationName(Long id) {
        String workstationName = getById(id).getName();
        return workstationName;
    }

}
